package net.vinant.idp4java.openid4javaImpl;

import javax.servlet.ServletConfig;

import org.openid4java.server.ServerManager;

import net.vinant.idp4java.base.BaseAuthenticationHandler;
import net.vinant.idp4java.base.BaseProtocolImplementation;
import net.vinant.idp4java.base.BaseServiceProxy;
import net.vinant.idp4java.base.InMemoryAuthenticationHandler;

public class SimpleServiceProxy extends BaseServiceProxy {
    // instantiate a ServerManager object
    //ServerManager manager = null;
    
    public SimpleServiceProxy(ServerManager serverManager) {
		super(serverManager);
	}

	/*	public SimpleServiceProxy(ServerManager serverManager) {
		super(serverManager);
	}*/
   

	@Override
	public BaseAuthenticationHandler getAuthenticationHandler() {
		return new InMemoryAuthenticationHandler(this);
	}

	@Override
	public BaseProtocolImplementation getProtocolImplementation() {		
		return new OpenId4JavaProtocolImplementation(this);
	}

	@Override
	protected void init() {
		getServerManager().setOPEndpointUrl("http://localhost:8081/idp4java/endpoint");
        // for a working demo, not enforcing RP realm discovery
        // since this new feature is not deployed
		getServerManager().getRealmVerifier().setEnforceRpId(false);       
		getServerManager().setEnforceRpId(false);
		//getServerManager().setUserSetupUrl("http://localhost:8081/idp4java/login.jsp");
		
	}

}
